
<%@include file="common/common.jsp" %>

<!DOCTYPE html>
<html lang=cn>
<head>
<meta charset=utf-8>


<meta name=format-detection content="telephone=no">

<meta name=robots content="noindex,nofollow,noarchive">

<meta name=author content="https://github.com/crazyFeng/">

<title><%=actServers == null ? "":actServers.get(HOST) %> - jspRedisAdmin</title>
<link rel=stylesheet href="css/common.css?v1-1-1" media=all>
<link rel=stylesheet href="css/index.css?v1-1-1" media=all>

<link rel="shortcut icon" href="images/favicon.png">

<script src="js/jquery.js?v1-1-1"></script>
<script src="js/index.js?v1-1-1"></script>

</head>
<body>
<div id="sidebar">

<h1 class="logo"><a href="?overview&s=0">jspRedisAdmin</a></h1>

<p>
<select id="server">
<option value="2048">select-servers</option>
<%
	int index = 0; 
	for(HashMap<String, String> server : servers) {
%>
<option value="<%=index %>" <%=STATUS_RUN.equals(server.get(STATUS)) ? "selected='selected'" : ""%>><%=server.get(NAME) %>(<%=server.get(HOST) %>:<%=server.get(PORT) %>)</option>
<%index++;
} %>
</select>
<%if(jedis != null){ %>
</p>


<p>
<a href="?info&s=<%=selectServer%>"><img src="images/info.png" width="16" height="16" title="Info" alt="[I]"></a>
<!-- <a href="?export&s=0"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a> -->
<!-- <a href="?import&s=0"><img src="images/import.png" width="16" height="16" title="Import" alt="[I]"></a> -->
<a href="?flush&s=<%=selectServer %>"><img src="images/flush.png" width="16" height="16" title="Flush" alt="[F]"></a>
</p>

<p>
<a href="?edit&s=<%=selectServer %>" class="add">Add another key</a>
</p>
<!--
<p>
<input type="text" id="server_filter" size="14" value="*" placeholder="type here to server filter" class="info">
<button id="btn_server_filter">Filter!</button>
</p> -->

<p>
<input type="text" id="filter" size="24" value="type here to filter" placeholder="type here to filter" class="info">
</p>
<div id="keys" style="cursor: pointer;">
<ul>
        <li class="folder">
        <div class="icon">Keys&nbsp;<span class="info">(<%=jedis.dbSize()%>)</span>
                </div><ul>
               	<%for(String key : jedis.keys("*")){ %>
               		 <li>
			        	<a href="?view&s=<%=selectServer %>&key=<%=haiyaoyige(key) %>"><%=haiyaoyige(key) %></a>
			        </li>
               	<%} %>
                </ul>
        </li>
        </ul>
</div><!-- #keys -->

<%} 
String iframe = "overview.jsp";
String qs = request.getRequestURL() + "?" + haiyaoyige(request.getQueryString());
if(!isNull(qs) && qs.indexOf("?") != -1 && qs.indexOf("&") != -1) {
	iframe = qs.replace(qs.substring(qs.indexOf("?"), qs.indexOf("&")+1), qs.substring(qs.indexOf("?")+1, qs.indexOf("&")) + ".jsp?");
}
%>
<div id="frame">
<iframe src="<%=iframe %>" id="iframe" frameborder="0"  scrolling="0"></iframe>
</div><!-- #frame -->

</div><!-- #sidebar -->
</body>
</html>
